/** 
 * @date 06/05/2013
 * @author Renet_Pourriau
 * @version 1.0
 */

package mesure;

/**
 * This class represent amount
 */
public class Quantite {

	private Integer entier;

	private Integer decimal;

	/**
	 * this is the constructor of amount
	 * @param entier
	 * @param decimal
	 */
	public Quantite(Integer entier, Integer decimal) {
		this.setEntier(entier);
		this.setDecimal(decimal);
	}

	/**
	 * @return the entier
	 */
	public Integer getEntier() {
		return entier;
	}

	/**
	 * @param entier
	 *            the entier to set
	 */
	public void setEntier(Integer entier) {
		this.entier = entier;
	}

	/**
	 * @return the decimal
	 */
	public Integer getDecimal() {
		return decimal;
	}

	/**
	 * @param decimal
	 *            the decimal to set
	 */
	public void setDecimal(Integer decimal) {
		this.decimal = decimal;
	}

	/**
	 * @return Double representing amount
	 */
	public Double getQuantite() {
		return new Double(this.getEntier() + "." + this.getDecimal());
	}

	/**
	 * @param quantite
	 * @return true if the two amounts are equals
	 */
	public Boolean estEgale(Quantite quantite) {
		return this.getQuantite().equals(quantite.getQuantite());
	}

	/**
	 * @param quantite
	 * @return true if current amount is smaller than parameter amount
	 */
	public Boolean estPlusPetit(Quantite quantite) {
		return this.getQuantite() < quantite.getQuantite();
	}

	/**
	 * @param quantite
	 * @return true if current amount is greater than parameter amount
	 */
	public Boolean estPlusGrand(Quantite quantite) {
		return this.getQuantite() > quantite.getQuantite();
	}

}